package com.example.travelservlet.oss.controller;

import com.example.travelservlet.oss.service.OssService;
import com.example.travelservlet.user.domain.Result;
import com.example.travelservlet.utils.ResultUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

/**
 * @author hxy
 * @date 2023/5/15 15:03
 */
@RestController
@RequestMapping("/oss")
public class OssController {
    @Autowired
    private OssService ossService;
    @PostMapping("/uploadOssFile")
    public Result uploadOssFile(MultipartFile file){
        String url = ossService.uploadOssFile(file);
        return ResultUtil.success(url);
    }
}